package cn.com.taiji.pos.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.UUID;

/**
 * <p>
 * 消费主单
 * </p>
 *
 * @author
 * @since 2021-03-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TradeConsumptionMain implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "ID", type = IdType.ASSIGN_UUID)
    private String id;
    /**
     * 所属餐厅
     */
    @TableField("RESTAURANT_ID")
    private String restaurantId;

    /**
     * 所属餐次
     */
    @TableField("MEAL_TIME_ID")
    private String mealTimeId;

    /**
     * POS机
     */
    @TableField("POS_MACHINE_ID")
    private String posMachineId;

    /**
     * 流水单号(对应交易流水)
     */
    @TableField("FLOW_NO")
    private String flowNo;

    /**
     * 消费时间
     */
    @TableField("CONSUMPTION_TIME")
    private LocalDateTime consumptionTime;

    /**
     * 点餐类型(0:消费 1:赠送 2:退菜)
     */
    @TableField("ORDER_TYPE")
    private Integer orderType;

    /**
     * 所属顾客(现金结算时为空)
     */
    @TableField("CUSTOMER_ID")
    private String customerId;

    @TableField("QUANTITY")
    private Double quantity;

    /**
     * 应付总额((无折扣时)
     */
    @TableField("SHOULD_PAID_AMOUNT")
    private Double shouldPaidAmount;

    /**
     * 实际总额(打折之后)
     */
    @TableField("ACTUAL_AMOUNT")
    private Double actualAmount;

    /**
     * 折扣比例
     */
    @TableField("DISCOUNT_PERCENT")
    private BigDecimal discountPercent;

    /**
     * 折扣总额
     */
    @TableField("DISCOUNT_AMOUNT")
    private Double discountAmount;

    /**
     * 人工折扣原因
     */
    @TableField("REASON_ID")
    private String reasonId;

    /**
     * 定额消费价格
     */
    @TableField("QUOTA_PRICE")
    private BigDecimal quotaPrice;

    /**
     * 消耗次数
     */
    @TableField("TIMES")
    private Integer times;

    /**
     * 是否已结算(0:未结算1:已结算)
     */
    @TableField("IS_SETTLEMENT")
    private String isSettlement;

    /**
     * 创建人
     */
    @TableField("CREATOR_ID")
    private String creatorId;

    /**
     * 创建人姓名
     */
    @TableField("CREATOR_NAME")
    private String creatorName;

    /**
     * 创建时间
     */
    @TableField("CREATE_TIME")
    private LocalDateTime createTime;

    /**
     * 是否导出xml(0:否1:是)
     */
    @TableField("XML_OUT")
    private String xmlOut;

    @TableField("TABLE_NO")
    private String tableNo = UUID.randomUUID().toString().replaceAll("-", "").substring(0, 14);

    @TableField("CUSTOMER_ADDRESS")
    private String customerAddress;

    @TableField("CUSTOMER_ARCHITECTURE")
    private String customerArchitecture;

    @TableField("CUSTOMER_PHONE")
    private String customerPhone;

    @TableField("CUSTOMER_NAME")
    private String customerName;

    @TableField("PRINT_STATUS")
    private String printStatus = "0";

    @TableField("CUSTOMER_FLOOR")
    private String customerFloor;

    /**
     * 订单状态(0:未支付1:已支付2:已退款3:退款审批中)
     */
    @TableField("ORDER_STATUS")
    private String orderStatus = "1";

    @TableField("TAKE_MEAL_TYPE")
    private String takeMealType;

    @TableField("REMARKS")
    private String remarks;

    @TableField("ACCOUNT_ID")
    private String accountId;



}
